
import App from './App'
import store from "./store"
import { toast } from "@/utils"

// #ifndef VUE3
import Vue from 'vue'
import Filter from "@/filters"
import GlobalMixin from "@/mixins/globalMixin"
import uView from "@/uni_modules/uview-ui"
import "@/uni_modules/uview-ui/index.scss";
Vue.use(uView)
Vue.config.productionTip = false
Vue.prototype.toast = toast

// 挂载全局过滤器
Object.keys(Filter).forEach(key => {
  Vue.filter(key, Filter[key])
})

// 全局混入
Vue.mixin(GlobalMixin)

// 全局错误捕获
// Vue.config.warnHandler = function(msg, vm, trace) {
// 	console.log(msg, vm, trace)
// }


App.mpType = 'app'

const app = new Vue({
	store,
    ...App,
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif